/**
 * 
 */
package it.robertobifulco.ias.test.repository;

import it.robertobifulco.ias.principalmanager.ImpossibleToIdentifyPrincipalException;
import it.robertobifulco.ias.principalmanager.PrincipalRepository;

/**
 * @author Roberto Bifulco [info@robertobifulco.it, robertobifulco.it]
 *
 */
public class PrincipalRepositoryTEST implements PrincipalRepository {

	/* (non-Javadoc)
	 * @see it.robertobifulco.ias.principalmanager.PrincipalRepository#getPrincipalPassword(java.lang.String)
	 */
	@Override
	public String getPrincipalPassword(String principalID)
			throws ImpossibleToIdentifyPrincipalException {
		if(principalID.equals("roberto")){
			return "admin";
		} else if(principalID.equals("rob")){
			return "user";
		} else
			throw new ImpossibleToIdentifyPrincipalException();
	}

	/* (non-Javadoc)
	 * @see it.robertobifulco.ias.principalmanager.PrincipalRepository#getPrincipalRole(java.lang.String)
	 */
	@Override
	public String getPrincipalRole(String principalID)
			throws ImpossibleToIdentifyPrincipalException {
		if(principalID.equals("roberto")){
			return "Admin";
		} else if(principalID.equals("rob")){
			return "User";
		} else
			throw new ImpossibleToIdentifyPrincipalException();
	}

}
